import 'package:flutter/material.dart';
import 'package:flutter_comm_base_framework/core/CommBasePage.dart';
import 'package:flutter_comm_base_framework/core/utils/CupertinoLocalizationsDelegate.dart';
import 'package:flutter_comm_base_framework_example/test_page.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends CommBasePage {

  @override
  CommBaseState<CommBasePage> getPageState() {
    return _MyAppState();
  }
}

class _MyAppState extends CommBaseState<MyApp> {

  @override
  void initBaseParams() {
  }

  @override
  void initPageData() {

  }

  @override
  Widget getViewsWidget() {
    return MaterialApp(
      localizationsDelegates: [
        CupertinoLocalizationsDelegate(),
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: [
        const Locale('zh', 'CN'),
        const Locale('en', 'US'),
      ],
      title: "",
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        buttonTheme: new ButtonThemeData(
            minWidth: 0,
            height: 0,
            padding: EdgeInsets.all(0),
            buttonColor: Colors.transparent),
      ),
      home: TestPage(),
    );
  }
}
